#include <QApplication>

#include <plugin/PluginContext.h>
#include <pluginui/widget/StandardMainWindow.h>
#include <pluginui/widget/StandardMainDialog.h>
#include <pluginui/widget/StandardSystemTrayDialog.h>

/**
 * @brief This project together with projects guiplugin1 and guiplugin2
 *        serve as a simple and quick start on how to use the plugin
 *        system.
 * First, you need to start your PluginActivator. Of course, if you happen
 * to use Qt's widgets and will stick to QMainWindow as your primary interface,
 * you are in luck, because all you need to do is instantiate a
 * antu::plugin::ui::StandardMainWindow object, show it and execute it.
 * That is all, and your plugin system is up and running, of course, without
 * any actual plugins yet. Now move on to guiplugin1 project and we'll
 * show you how to create your own plugins.
 *
 * If you do not have a gui interface, or do not wish to use Qt's widgets,
 * or do not want to start with QMainWindow as your main interface, you'd need
 * to do a bit more work. Refer to code in antu::plugin::ui::StandardMainWindow
 * on how to start your plugin system. Basically, you'd need to first create
 * a PluginContext, which is used as a global object for the plugin system,
 * and then initialize FrameworkPlugin::Framework object which is a singleton
 * of FrameworkPlugin instance. And last, instantiate and run your PluginActivator
 * object, and that's it.
 *
 * @param argc
 * @param argv
 * @return
 */
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    antu::plugin::PluginContext context;
    context.setApplicationName("Test Plugin App");
    context.setApplicationGroup("MONITOR");

    antu::plugin::ui::StandardMainWindow w(&context);
    w.showMaximized();

//    a.setQuitOnLastWindowClosed(false);

//    antu::plugin::ui::StandardSystemTrayDialog dlg(&context, nullptr, QIcon());
//    dlg.show();
    return a.exec();
}
